﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminContact.aspx.cs" Inherits="Admin_AdminContact" %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
    
    <script type="text/javascript">
    function view(id){
	document.getElementById(id).style.display=''	
    }
    function hide(id){
	document.getElementById(id).style.display='none'		
    }
    function viewComMakeOps()
    {
        view('add');
        hide('adminC');
        document.getElementById("makeHtmlTab").getElementsByTagName("li")[0].className="hover";document.getElementById("makeHtmlTab").getElementsByTagName("li")[1].className=""
        
    }
    function viewSpeMakeOps()
    {
 
        hide('add');
        view('adminC');
        document.getElementById("makeHtmlTab").getElementsByTagName("li")[1].className="hover";document.getElementById("makeHtmlTab").getElementsByTagName("li")[0].className=""
    }
    </script>
</head>
<body onload='$("#loading").hide()'>
<div id="loading" style="display:block" >   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>

    <form name="addform" id="addformAjax"  method="post"  >    
    <div id="cpcontainer" class="container">
<!--当前导航-->
<%--<script type="text/JavaScript">if(parent.document.getElementById('admincpnav')) parent.document.getElementById('admincpnav').innerHTML='后台首页&amp;nbsp;&amp;raquo;&amp;nbsp;生成&amp;nbsp;&amp;raquo;&amp;nbsp;生成选项';</script>--%>
<ul id="makeHtmlTab">
<li class="hover"><a href="javascript:void(0)" onclick="viewComMakeOps();">管理联系人</a></li>
<li><a href="javascript:void(0)" onclick="viewSpeMakeOps();">添加联系人</a></li>
</ul>
<table class="tb">
<tbody id="add">
	<tr bgcolor="#f5fafe">
	<td style="width: 5%">ID<a href="#"><img src="imgs/minus.gif" title="按ID排序" /></a></td>
	<td style="width: 10%"> 姓名(Name)</td>
	<td style="width: 10%">
        职位(Post)<a href="#"><img src="imgs/minus.gif" title="按人气排序" /></a></td>
        <td style="width: 10%">性别(Sex)</td>
	<td style="width: 10%">
        联系QQ/msn</td>
		<td style="width: 10%">
        邮件地址</td>
	<td style="width: 10%">手机号码<a href="#"><img src="imgs/minus.gif" title="按时间排序" /></a></td>
<td style="width: 10%">
        添加日期</td>
	<td style="width: 35%" align="left">
        (编辑,删除)操作</td>
  </tr>
  <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
        <tr bgcolor="#f5fafe" id="tr<%#Eval("contactId")%>">
	<td ><%#Eval("contactId")%></td>
	<td style="width: 179px"><a  href="#" onclick="EditContact(this.title)"  title='<%#Eval("contactId")%>'><%#Eval("Name") %></a><span id="state1"><img src="imgs/icon_01.gif"   style="cursor:pointer"  /></span></td>
	<td><%#Eval("post") %></td>
	<td>
        <span style="color: #2366a8"></span>  <%#Eval("Sex").ToString()=="True"?"男(man)":"女(woman)"%></td>
	<td>
        <%#Eval("qq")%></td>
	
   <td align="left">
       <span style="font-size: 7pt; color: #ff0000"><%#Eval("Email") %></span></td>
          <td align="left">
       <span style="font-size: 7pt; color: #ff0000">  <%#Eval("Tel")%></span></td>
               <td align="left"><%#Eval("contactDate","{0:d}")%></td>
	<td style="width: 600px">
	<script type="text/javascript">
	function EditContact(id)
	{
	
        location.href="EditContact.aspx?state=edit&id="+id;     
	}
	</script>
	  <input id="Button5" type="button" value="编辑" class='btn' title='<%#Eval("contactId")%>' onclick="EditContact(this.title)"/>
	   <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("contactId")%>' onclick="if(confirm('确定要删除吗')){$.get('?state=del&id='+this.title,'',function(msg){location.href=location.href;});}else{return false}"/>
	</td>
  </tr>
        </ItemTemplate>
        </asp:Repeater>
   </tbody>
  <tbody id="adminC" style="display:none;">
    
	<tr>
<td style="width: 238px"><img src="imgs/upload_topinforb.gif"></td>
<td>
<table width="100%" border="0">
    <tbody>
    <tr>
        <th width="25%" align="right" style="height: 32px">
            <span style="color:Red">*</span>姓&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
        <td width="75%" style="height: 32px">
            <input type="text" class="inputField followedObj" maxlength="100" size="40" id="FullName" name="FullName" runat="server">
        </td>
    </tr>
    <tr>
        <th valign="top" align="right">
        &nbsp;
            职&nbsp;&nbsp;&nbsp;&nbsp;位：</th>
        <td>
            <input type="text" class="inputField followedObj" maxlength="20" size="20" id="Duty" name="Duty" runat="server">
        </td>
    </tr>
    <tr>
        <th align="right">
        <span style="color: #ff0000">*</span>性&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
        <td>
            男<input type="radio" id="Sex_1" name="sex" value="1" runat="server" checked="true">
            女<input type="radio" id="Sex_2" name="sex" value="0" runat="server">
        </td>
    </tr>
    <tr>
        <th align="right">
            &nbsp; 联系QQ/msn：</th>
        <td>
            <input type="text" class="inputField followedObj" maxlength="500" size="40" id="qq" name="qq" runat="server">
        </td>
    </tr>
    <tr>
        <th valign="top" align="right">
            <span style="color: #ff0000">*</span>邮件地址：</th>
        <td>
            <input type="text" class="inputField followedObj" maxlength="500" size="40" id="Email" name="Email" runat="server"><br>
            - 请准确填写电子邮件信息<br>
            - 以便顾客较快的联系到您。
        </td>
    </tr>
    <tr>
        <th valign="top" align="right">                                                &nbsp;
            手机号码:</th>
        <td>
            <input type="text" class="inputField followedObj" maxlength="50" size="40" id="Mobile" name="Mobile" runat="server">
        </td>
    </tr>
    <tr>
        <th valign="top" align="right" style="height: 42px"></th>
        <td style="height: 42px">
            <input type="button" value="提交个人信息..." class="btn" name="Submit" id="tijiao">
             <input type="reset" class="btn" value="重置">
        </td>
    </tr>
                                        </tbody></table>
 
        <input id="Hiddenid" runat="server" type="hidden" name="Hiddenid"/></td>                                 
  </tr>
                        

</tbody>
    
</table>  <uc1:adminfoot ID="Adminfoot1" runat="server" />
</div>
      

</form>
<script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "?state=add",         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
            $("#loading").show();
            $('#addformAjax').ajaxSubmit(options);
            return false;
    });
})
function showResponse(msg){ 
if(msg=="1")
        {
           
            alert("添加成功!!!");
            $("#loading").hide();
            location.href=location.href;
        }
        else
        {
            alert(msg);
            $("#loading").hide();
        }
} 
function showRequest(formData, jqForm, options)
{ 		
    return true; 
} 

</script>
</body>
</html>
